//
// Created by Andrea Petreti on 27/10/2021.
//

#ifndef ANDROIDPDFVIEWER_DOCUMENTFILE_H
#define ANDROIDPDFVIEWER_DOCUMENTFILE_H

#include <string>
#include <vector>
#include <mutex>
#include <exception>
#include <fpdfview.h>

class DocumentFile {
private:
    static std::mutex lockInitLibrary;
    static int libraryReferenceCount;
    static void destroyLibraryIfNeeded();
    static void initLibraryIfNeeded();
    int fileFd;

public:
    FPDF_DOCUMENT pdfDocument = NULL;
    size_t fileSize;

    DocumentFile();
    ~DocumentFile();
};



#endif //ANDROIDPDFVIEWER_DOCUMENTFILE_H
